<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSteamUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('steam_users', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('uid')->unsigned();
            $table->integer('communityvisibilitystate')->nullable();
            $table->integer('profilestate')->nullable();
            $table->string('personaname', 64)->nullable();
            $table->string('lastlogoff', 32)->nullable();
            $table->integer('commentpermission')->nullable();
            $table->string('profileurl', 255)->nullable();
            $table->string('avatar', 255)->nullable();
            $table->string('avatarmedium', 255)->nullable();
            $table->string('avatarfull', 255)->nullable();
            $table->integer('personastate')->nullable();
            $table->string('realname', 64)->nullable();
            $table->string('primaryclanid', 64)->nullable();
            $table->integer('timecreated')->nullable();
            $table->integer('personastateflags')->nullable();
            $table->string('loccountrycode', 64)->nullable();
            $table->integer('locstatecode')->nullable();
            $table->integer('loccityid')->nullable();
            $table->string('steamID64', 64);
            $table->string('steamID', 32);
            $table->foreign('uid')->references('id')->on('users');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('steam_users');
    }
}
